package com.wd.elec.common.enums;

/**
 * @className: PowerUnitCategory
 * @description: TODO 类描述
 * @author: liumingkun
 * @date: 2024/9/5
 **/
public enum PowerUnitCategory {

    coal(1), //煤电
    coal_ccs(2), //煤电 ccs
    gas(3), //气电
    gas_ccs(4),  //气电 ccs
    biomass(5), //生物质能
    biomass_ccs(6),//生物质能 css

    water(7), //水电
    nuclear(8), //核电

    pv(9), //光伏
    pv_net(10), //净光伏
    pv_discard(11), //光伏弃光

    pv_sea(12), //海上光伏
    pv_sea_net(13), //净海上光伏
    pv_sea_discard(14), //海上光伏弃光

    wind(15), //风电
    wind_net(16), //净风电
    wind_discard(17), //风电弃风

    wind_sea(18), //海上风电
    wind_sea_net(19), //净海上风电
    wind_sea_discard(20), //海上风电弃风

    solar_thermal(21), //光热
    solar_thermal_soc(22), //光热SOC
    storage(23), //储能
    storage_soc(24), //储能SOC
    storage_water(25), //抽水蓄能
    storage_electrochemical(26), //电化学储能

    from_superior_grid(27); //上级电网传输电能


    private final int value;

    // 构造函数
    PowerUnitCategory(int value) {
        this.value = value;
    }

    // 获取枚举的 int 值
    public int getValue() {
        return value;
    }

    // 根据 int 值获取对应的枚举
    public static PowerUnitCategory fromValue(int value) {
        for (PowerUnitCategory category : PowerUnitCategory.values()) {
            if (category.getValue() == value) {
                return category;
            }
        }
        throw new IllegalArgumentException("Invalid value: " + value);
    }
}
